Left Termination of the query pattern
mergesort_in_2(g, a)
w.r.t. the given Prolog program could successfully be proven:
↳ Prolog
↳ PredefinedPredicateTransformerProof
Clauses:
mergesort([], []).
mergesort(.(X, []), .(X, [])).
mergesort(.(X, .(Y, Xs)), Ys) :- ','(split(.(X, .(Y, Xs)), X1s, X2s), ','(mergesort(X1s, Y1s), ','(mergesort(X2s, Y2s), merge(Y1s, Y2s, Ys)))).
split([], [], []).
split(.(X, Xs), .(X, Ys), Zs) :- split(Xs, Zs, Ys).
merge([], Xs, Xs).
merge(Xs, [], Xs).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(=(X, Y), merge(.(X, Xs), Ys, Zs)).
Queries:
mergesort(g,a).
Added definitions of predefined predicates.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
Clauses:
mergesort([], []).
mergesort(.(X, []), .(X, [])).
mergesort(.(X, .(Y, Xs)), Ys) :- ','(split(.(X, .(Y, Xs)), X1s, X2s), ','(mergesort(X1s, Y1s), ','(mergesort(X2s, Y2s), merge(Y1s, Y2s, Ys)))).
split([], [], []).
split(.(X, Xs), .(X, Ys), Zs) :- split(Xs, Zs, Ys).
merge([], Xs, Xs).
merge(Xs, [], Xs).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(=(X, Y), merge(.(X, Xs), Ys, Zs)).
=(X, X).
Queries:
mergesort(g,a).
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergesort_in: (b,f)
split_in: (b,f,f)
merge_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
Pi-finite rewrite system:
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_GAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → U5_GAA(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_GA(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_GA(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → MERGE_IN_GGA(Y1s, Y2s, Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → =_IN_GG(X, Y)
U6_GGA(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U6_GGA(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
U7_GGA(x1, x2, x3, x4, x5, x6) = U7_GGA(x1, x6)
U6_GGA(x1, x2, x3, x4, x5, x6) = U6_GGA(x1, x2, x4, x6)
U2_GA(x1, x2, x3, x4, x5, x6) = U2_GA(x5, x6)
U5_GAA(x1, x2, x3, x4, x5) = U5_GAA(x1, x5)
MERGE_IN_GGA(x1, x2, x3) = MERGE_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5, x6) = U3_GA(x5, x6)
U4_GA(x1, x2, x3, x4, x5) = U4_GA(x5)
MERGESORT_IN_GA(x1, x2) = MERGESORT_IN_GA(x1)
=_IN_GG(x1, x2) = =_IN_GG(x1, x2)
U1_GA(x1, x2, x3, x4, x5) = U1_GA(x5)
SPLIT_IN_GAA(x1, x2, x3) = SPLIT_IN_GAA(x1)
We have to consider all (P,R,Pi)-chains
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
Pi DP problem:
The TRS P consists of the following rules:
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_GAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → U5_GAA(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_GA(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_GA(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
U3_GA(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → MERGE_IN_GGA(Y1s, Y2s, Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → =_IN_GG(X, Y)
U6_GGA(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_GGA(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U6_GGA(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
U7_GGA(x1, x2, x3, x4, x5, x6) = U7_GGA(x1, x6)
U6_GGA(x1, x2, x3, x4, x5, x6) = U6_GGA(x1, x2, x4, x6)
U2_GA(x1, x2, x3, x4, x5, x6) = U2_GA(x5, x6)
U5_GAA(x1, x2, x3, x4, x5) = U5_GAA(x1, x5)
MERGE_IN_GGA(x1, x2, x3) = MERGE_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5, x6) = U3_GA(x5, x6)
U4_GA(x1, x2, x3, x4, x5) = U4_GA(x5)
MERGESORT_IN_GA(x1, x2) = MERGESORT_IN_GA(x1)
=_IN_GG(x1, x2) = =_IN_GG(x1, x2)
U1_GA(x1, x2, x3, x4, x5) = U1_GA(x5)
SPLIT_IN_GAA(x1, x2, x3) = SPLIT_IN_GAA(x1)
We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 7 less nodes.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDP
Pi DP problem:
The TRS P consists of the following rules:
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
U6_GGA(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
U6_GGA(x1, x2, x3, x4, x5, x6) = U6_GGA(x1, x2, x4, x6)
MERGE_IN_GGA(x1, x2, x3) = MERGE_IN_GGA(x1, x2)
We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
↳ PiDP
Pi DP problem:
The TRS P consists of the following rules:
MERGE_IN_GGA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_GGA(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
U6_GGA(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → MERGE_IN_GGA(.(X, Xs), Ys, Zs)
The TRS R consists of the following rules:
=_in_gg(X, X) → =_out_gg(X, X)
The argument filtering Pi contains the following mapping:
.(x1, x2) = .(x1, x2)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U6_GGA(x1, x2, x3, x4, x5, x6) = U6_GGA(x1, x2, x4, x6)
MERGE_IN_GGA(x1, x2, x3) = MERGE_IN_GGA(x1, x2)
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PiDP
↳ PiDP
Q DP problem:
The TRS P consists of the following rules:
U6_GGA(X, Xs, Ys, =_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)
MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Ys, =_in_gg(X, Y))
The TRS R consists of the following rules:
=_in_gg(X, X) → =_out_gg
The set Q consists of the following terms:
=_in_gg(x0, x1)
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- U6_GGA(X, Xs, Ys, =_out_gg) → MERGE_IN_GGA(.(X, Xs), Ys)
The graph contains the following edges 3 >= 2
- MERGE_IN_GGA(.(X, Xs), .(Y, Ys)) → U6_GGA(X, Xs, Ys, =_in_gg(X, Y))
The graph contains the following edges 1 > 1, 1 > 2, 2 > 3
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
Pi DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
SPLIT_IN_GAA(x1, x2, x3) = SPLIT_IN_GAA(x1)
We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
Pi DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_GAA(Xs, Zs, Ys)
R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2) = .(x1, x2)
SPLIT_IN_GAA(x1, x2, x3) = SPLIT_IN_GAA(x1)
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PiDP
Q DP problem:
The TRS P consists of the following rules:
SPLIT_IN_GAA(.(X, Xs)) → SPLIT_IN_GAA(Xs)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- SPLIT_IN_GAA(.(X, Xs)) → SPLIT_IN_GAA(Xs)
The graph contains the following edges 1 > 1
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
Pi DP problem:
The TRS P consists of the following rules:
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GA(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U1_GA(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GA(X1s, Y1s)
MERGESORT_IN_GA(.(X, .(Y, Xs)), Ys) → U1_GA(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
U2_GA(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → MERGESORT_IN_GA(X2s, Y2s)
The TRS R consists of the following rules:
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, Xs)), Ys) → U1_ga(X, Y, Xs, Ys, split_in_gaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(X, Xs), .(X, Ys), Zs) → U5_gaa(X, Xs, Ys, Zs, split_in_gaa(Xs, Zs, Ys))
U5_gaa(X, Xs, Ys, Zs, split_out_gaa(Xs, Zs, Ys)) → split_out_gaa(.(X, Xs), .(X, Ys), Zs)
U1_ga(X, Y, Xs, Ys, split_out_gaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ga(X, Y, Xs, Ys, X2s, mergesort_in_ga(X1s, Y1s))
U2_ga(X, Y, Xs, Ys, X2s, mergesort_out_ga(X1s, Y1s)) → U3_ga(X, Y, Xs, Ys, Y1s, mergesort_in_ga(X2s, Y2s))
U3_ga(X, Y, Xs, Ys, Y1s, mergesort_out_ga(X2s, Y2s)) → U4_ga(X, Y, Xs, Ys, merge_in_gga(Y1s, Y2s, Ys))
merge_in_gga([], Xs, Xs) → merge_out_gga([], Xs, Xs)
merge_in_gga(Xs, [], Xs) → merge_out_gga(Xs, [], Xs)
merge_in_gga(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_gga(X, Xs, Y, Ys, Zs, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg(X, X)
U6_gga(X, Xs, Y, Ys, Zs, =_out_gg(X, Y)) → U7_gga(X, Xs, Y, Ys, Zs, merge_in_gga(.(X, Xs), Ys, Zs))
U7_gga(X, Xs, Y, Ys, Zs, merge_out_gga(.(X, Xs), Ys, Zs)) → merge_out_gga(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ga(X, Y, Xs, Ys, merge_out_gga(Y1s, Y2s, Ys)) → mergesort_out_ga(.(X, .(Y, Xs)), Ys)
The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2) = mergesort_in_ga(x1)
[] = []
mergesort_out_ga(x1, x2) = mergesort_out_ga(x2)
.(x1, x2) = .(x1, x2)
U1_ga(x1, x2, x3, x4, x5) = U1_ga(x5)
split_in_gaa(x1, x2, x3) = split_in_gaa(x1)
split_out_gaa(x1, x2, x3) = split_out_gaa(x2, x3)
U5_gaa(x1, x2, x3, x4, x5) = U5_gaa(x1, x5)
U2_ga(x1, x2, x3, x4, x5, x6) = U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6) = U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5) = U4_ga(x5)
merge_in_gga(x1, x2, x3) = merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3) = merge_out_gga(x3)
U6_gga(x1, x2, x3, x4, x5, x6) = U6_gga(x1, x2, x4, x6)
=_in_gg(x1, x2) = =_in_gg(x1, x2)
=_out_gg(x1, x2) = =_out_gg
U7_gga(x1, x2, x3, x4, x5, x6) = U7_gga(x1, x6)
U2_GA(x1, x2, x3, x4, x5, x6) = U2_GA(x5, x6)
MERGESORT_IN_GA(x1, x2) = MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5) = U1_GA(x5)
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
Q DP problem:
The TRS P consists of the following rules:
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs))))
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
The TRS R consists of the following rules:
mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Ys, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg
U6_gga(X, Xs, Ys, =_out_gg) → U7_gga(X, merge_in_gga(.(X, Xs), Ys))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)
The set Q consists of the following terms:
mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
=_in_gg(x0, x1)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
U4_ga(x0)
We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(split_in_gaa(.(X, .(Y, Xs)))) at position [0] we obtained the following new rules:
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(U5_gaa(X, split_in_gaa(.(Y, Xs))))
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ Rewriting
Q DP problem:
The TRS P consists of the following rules:
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(U5_gaa(X, split_in_gaa(.(Y, Xs))))
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
The TRS R consists of the following rules:
mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Ys, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg
U6_gga(X, Xs, Ys, =_out_gg) → U7_gga(X, merge_in_gga(.(X, Xs), Ys))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)
The set Q consists of the following terms:
mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
=_in_gg(x0, x1)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
U4_ga(x0)
We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(U5_gaa(X, split_in_gaa(.(Y, Xs)))) at position [0,1] we obtained the following new rules:
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(U5_gaa(X, U5_gaa(Y, split_in_gaa(Xs))))
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ Rewriting
↳ QDP
↳ QDPOrderProof
Q DP problem:
The TRS P consists of the following rules:
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(U5_gaa(X, U5_gaa(Y, split_in_gaa(Xs))))
U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
The TRS R consists of the following rules:
mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Ys, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg
U6_gga(X, Xs, Ys, =_out_gg) → U7_gga(X, merge_in_gga(.(X, Xs), Ys))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)
The set Q consists of the following terms:
mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
=_in_gg(x0, x1)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
U4_ga(x0)
We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].
The following pairs can be oriented strictly and are deleted.
MERGESORT_IN_GA(.(X, .(Y, Xs))) → U1_GA(U5_gaa(X, U5_gaa(Y, split_in_gaa(Xs))))
The remaining pairs can at least be oriented weakly.
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( U6_gga(x1, ..., x4) ) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
M( split_out_gaa(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( mergesort_in_ga(x1) ) = | | + | | · | x1 |
M( U3_ga(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( =_in_gg(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( U2_ga(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( .(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( merge_in_gga(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( U5_gaa(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( mergesort_out_ga(x1) ) = | | + | | · | x1 |
M( U7_gga(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( merge_out_gga(x1) ) = | | + | | · | x1 |
M( split_in_gaa(x1) ) = | | + | | · | x1 |
Tuple symbols:
M( U2_GA(x1, x2) ) = | 0 | + | | · | x1 | + | | · | x2 |
M( MERGESORT_IN_GA(x1) ) = | 0 | + | | · | x1 |
Matrix type:
We used a basic matrix type which is not further parametrizeable.
As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:
split_in_gaa([]) → split_out_gaa([], [])
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Ys, =_in_gg(X, Y))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U6_gga(X, Xs, Ys, =_out_gg) → U7_gga(X, merge_in_gga(.(X, Xs), Ys))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
↳ Prolog
↳ PredefinedPredicateTransformerProof
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ Rewriting
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
Q DP problem:
The TRS P consists of the following rules:
U1_GA(split_out_gaa(X1s, X2s)) → MERGESORT_IN_GA(X1s)
U2_GA(X2s, mergesort_out_ga(Y1s)) → MERGESORT_IN_GA(X2s)
U1_GA(split_out_gaa(X1s, X2s)) → U2_GA(X2s, mergesort_in_ga(X1s))
The TRS R consists of the following rules:
mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, Xs))) → U1_ga(split_in_gaa(.(X, .(Y, Xs))))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(X, Xs)) → U5_gaa(X, split_in_gaa(Xs))
U5_gaa(X, split_out_gaa(Zs, Ys)) → split_out_gaa(.(X, Ys), Zs)
U1_ga(split_out_gaa(X1s, X2s)) → U2_ga(X2s, mergesort_in_ga(X1s))
U2_ga(X2s, mergesort_out_ga(Y1s)) → U3_ga(Y1s, mergesort_in_ga(X2s))
U3_ga(Y1s, mergesort_out_ga(Y2s)) → U4_ga(merge_in_gga(Y1s, Y2s))
merge_in_gga([], Xs) → merge_out_gga(Xs)
merge_in_gga(Xs, []) → merge_out_gga(Xs)
merge_in_gga(.(X, Xs), .(Y, Ys)) → U6_gga(X, Xs, Ys, =_in_gg(X, Y))
=_in_gg(X, X) → =_out_gg
U6_gga(X, Xs, Ys, =_out_gg) → U7_gga(X, merge_in_gga(.(X, Xs), Ys))
U7_gga(X, merge_out_gga(Zs)) → merge_out_gga(.(X, Zs))
U4_ga(merge_out_gga(Ys)) → mergesort_out_ga(Ys)
The set Q consists of the following terms:
mergesort_in_ga(x0)
split_in_gaa(x0)
U5_gaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
=_in_gg(x0, x1)
U6_gga(x0, x1, x2, x3)
U7_gga(x0, x1)
U4_ga(x0)
We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.